package com.wn.task.utils

import com.blankj.utilcode.util.LogUtils

/**
 * @Author: wn
 * @Date: 2024/8/14 16:00
 * @Description: 自定义埋点工具
 */
object LaunchTimer {
  object LaunchTimer {
    private var currentTime: Long = 0

    // 记录开始时间
    fun startRecord() {
      currentTime = System.currentTimeMillis()
    }

    // 记录结束时间，某个tag的耗时
    @JvmOverloads
    fun stopRecord(title: String = "") {
      val t = System.currentTimeMillis() - currentTime
      LogUtils.dTag("LaunchTimer", "$title | time：$t")
    }
  }
}